<?php


namespace api\crm\model;


use think\Model;

class OrderGoodsModel extends Model
{
    public function orderInfo()
    {
        return $this->belongsTo('OrderInfoModel', 'order_id');
    }

    public function goodsInfo()
    {
        return $this->hasOne('GoodsModel', 'id', 'goods_id');
    }

    public function goodsImg()
    {
        return $this->hasOne('GoodsModel', 'id', 'goods_id')->bind([
            'img' => 'goods_img'
        ]);
    }

    public function goodsSpec()
    {
        return $this->belongsTo('GoodsSpecModel', 'spec_id');
    }
}
